/*
	Name: 割点 
	Author: There,hello
	Date: 23-10-19 19:20
	Description: Luogu P3388
	Algorithm: Tarjan
*/
#include<bits/stdc++.h>
#define add(x,y) edge[++tail]=(dd){head[x],y};head[x]=tail;
struct dd{
    int ne,to;
}edge[202020];
int tail,head[10101];
int dfn[10101],low[10101],time_;
int n,m;
bool pd[10101];
void tarjan(int t,int fa){
    dfn[t]=low[t]=++time_;
    int cnt=0;
    for(int i=head[t];i;i=edge[i].ne){
        int to=edge[i].to;
        if(!dfn[to]){
            tarjan(to,t);
            ++cnt;
            if(low[to]>=dfn[t]&&fa!=0){
               pd[t]=1; 
            }
            low[t]=std::min(low[t],low[to]);
        }
        low[t]=std::min(low[t],dfn[to]);
    }
    if(cnt>1&&fa==0)pd[t]=1;
}
int main(){
    scanf("%d%d",&n,&m);
    for(int i=1,x,y;i<=m;++i){
        scanf("%d%d",&x,&y);
        add(x,y);add(y,x);
    }
    for(int i=1;i<=n;++i)
        if(!dfn[i])tarjan(i,0);
    int ans=0;
    for(int i=1;i<=n;++i)
    if(pd[i])ans++;
    printf("%d\n",ans);
    for(int i=1;i<=n;++i)
    if(pd[i])printf("%d ",i);
}